<template>
    <!-- 添加点击事件，记录最新一次点击操作的时间 -->
    <div id="app" @click="updateLastTime()">
        <el-container>
            <el-header>
                <span id="logo" class="way">
                    <img src="../../assets/images/logo.png" alt="" />
                </span>

                <span id="name">- 服装后台管理 -</span>

                <span id="user">
                    <el-avatar>
                        <img src="../../assets/images/logo.png" />
                        <!-- 图片地址动态绑定 -->
                    </el-avatar>

                    <el-dropdown>
                        <span class="uName">
                            {{ $store.state.current.userName }}
                            <i class="el-icon-arrow-down el-icon--right"></i>
                        </span>
                        <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item divided class="drop" @click.native="logout">
                                退出登录
                            </el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                </span>
            </el-header>

            <el-container id="container2">
                <el-aside>
                    <el-menu class="el-menu-vertical-demo" :default-active="this.activePath3" :collapse="isCollapse"
                        unique-opened router>
                        <el-submenu index="1">
                            <template slot="title">
                                <i class="el-icon-menu"></i>
                                <span slot="title">系统管理</span>
                            </template>
                            <el-menu-item-group>
                              <el-menu-item index="chart" @click="saveNavState('chart')">
                                首页图表
                              </el-menu-item>

                                <el-menu-item index="user_manage" @click="saveNavState('user_manage')">
                                    用户管理
                                </el-menu-item>

                                <el-menu-item index="goods_manage" @click="saveNavState('goods_manage')">
                                    货号管理
                                </el-menu-item>

                                <el-menu-item index="warehouse" @click="saveNavState('warehouse')">
                                    仓库管理
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>

                        <el-submenu index="2">
                            <template slot="title">
                                <i class="el-icon-box"></i>
                                <span slot="title">库存管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="inbound_manage" @click="saveNavState('inbound_manage')">
                                    入库管理
                                </el-menu-item>

                                <el-menu-item index="outbound_manage" @click="saveNavState('outbound_manage')">
                                    出库管理
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>

                        <el-submenu index="3">
                            <template slot="title">
                                <i class="el-icon-set-up"></i>
                                <span slot="title">辅助管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="change_password" @click="saveNavState('change_password')">
                                    修改密码
                                </el-menu-item>

                                <el-menu-item index="personal_information"
                                    @click="saveNavState('personal_information')">
                                    个人信息
                                </el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>

                    </el-menu>


                </el-aside>
                <el-main>
                    <span id="collapse_btn">
                        <el-button v-if="isCollapse" @click="open">
                            <i class="el-icon-s-unfold"></i>
                        </el-button>
                        <el-button v-if="!isCollapse" @click="close">
                            <i class="el-icon-s-fold"></i>
                        </el-button>
                    </span>
                    <!-- 路由占位符，展示子组件 -->
                    <router-view></router-view>
                </el-main>
            </el-container>

        </el-container>
        <dashboard></dashboard>
    </div>
</template>

<script src="../../assets/js/admin/admin.js">
</script>

<style scoped src="../../assets/css/admin/admin.css">
</style>